package com.API;

public class day01 {
    public static void main(String[] args) {
        //正值取正数 , 负值取相反数
        int abc = Math.abs(-10);
        System.out.println(abc);
        System.out.println("--------------");
        //浮点数取向上取整数 10.0不行
        double ceil = Math.ceil(10.1);
        System.out.println(ceil);
        System.out.println("--------------");
        //浮点数向下取整数
        double floor = Math.floor(10.9);
        System.out.println(floor);
        System.out.println("--------------");
        //四舍五入取整
        float round = Math.round(10.7);
        System.out.println(round);
        System.out.println("--------------");
        //返回两个较大的值
        int max = Math.max(10, 20);
        System.out.println(max);
        System.out.println("--------------");
        //返回两个较小的值
        int min = Math.min(10, 20);
        System.out.println(min);
        System.out.println("--------------");
        //返回a的b次幂的值
        double pow = Math.pow(20.3, 18.2);
        System.out.println(pow);
        System.out.println("--------------");
        //返回值为double的正值
        double random = Math.random();
        System.out.println(random);
    }
}
